home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1998 July / apc37.iso / netkit / mac / dcomet / dcomet.hqx / Documents / 0.2. Tips < prev    next >
Encoding:
Text File  |  1998-05-04  |  7.1 KB  |  117 lines

  1.  
  2.  
  3.                          0.2. Tips
  4.  
  5. _____________________________________________________________________________
  6.  
  7.       dataComet documentation.  (Rev. 5/4/98) 
  8.       Copyright 1998 databeast, Inc. All Rights Reserved.
  9.  
  10.    This document has information on (select and use "Find..." to go to the section):
  11.  
  12.          Using dataComet
  13.          The edit window "Enter" key
  14.          Chat and Talk interaction ("Command-Return") 
  15.          Recording macros
  16.          Editing and executing macros ("Shift-Enter")
  17.          The edit window "Enter" key
  18.          Reformatting web page text
  19.  
  20.  
  21.        ___________________________________________________
  22.  
  23.          Using dataComet
  24.        ___________________________________________________
  25.  
  26.    This document offers some pointers on using dataComet to get maximum productivity.  
  27.  
  28.    dataComet is especially useful in managing sessions with UNIX hosts.  These pointers also apply to other hosts, though the commands will differ under operating systems such as digital's VMS and IBM's VM and MVS.
  29.  
  30.     The key to minimizing time and effort using dataComet is using the edit window and macro features.  Host commands are sometimes complex and obscure; dataComet allows you to save complicated host commands or shell scripts in an edit window and execute them by selecting them and pressing the "Enter" key, which sends them to the host.  (Commands which are one line long can be selected by placing the cursor anywhere on the line containing the command you wish to execute.)
  31.  
  32.  
  33.        ___________________________________________________
  34.  
  35.          The edit window "Enter" key
  36.        ___________________________________________________
  37.  
  38.    As a simple example, take the UNIX command which lists files by modification date:
  39.  
  40. ls -lt
  41.  
  42.    After opening a session, you can execute the command above by bringing this window to the front, placing the cursor on the line containing "ls -lt", and pressing the "Enter" key.  If you have multiple session windows open, the command will be sent to the frontmost window with an open connection.
  43.  
  44.    The value of saving these commands in an edit window becomes more obvious when you are executing more complex commands.  For example, suppose you want to see a list of UNIX files sorted by size.  The "ls" command doesn't have an option to sort by file size, so you need to "pipe" the output of the "ls" command into the "sort" command:
  45.  
  46. ls -l | sort +3rn -4
  47.  
  48.    Here's another example.  Suppose you want to view a list of today's web hits without moving to the directory and using an editor:
  49.  
  50. cat /home/www/logs/databeast.com/19`date +%y%m%d`.accesses
  51.  
  52.    (Note this example won't work for you unless you change the directory "/home/www/logs/databeast.com/" to the directory which contains your own web hit logs.)
  53.  
  54.        ___________________________________________________
  55.  
  56.          Chat and Talk interaction ("Command-Return") 
  57.        ___________________________________________________
  58.  
  59.    The "Command-Return" key is used like the "Enter" key in an edit window, with the simple difference that "Command-Return" adds a line break at the cursor position before sending the line to the host.
  60.  
  61.    This makes it easy to use "chat" and "talk" programs on the host.  You can type a line to send in an edit window and then send it to the host with "Command-Return"; if you want to edit the line before sending it, you can change the line, and then send it using either "Enter" or "Command-Return".
  62.  
  63.  
  64.        ___________________________________________________
  65.  
  66.          Recording macros
  67.        ___________________________________________________
  68.  
  69.    You can use the "Macros" menu "Record actions for macro..." command to automatically record interactions with a host and generate a macro.  When you're finished recording, select the "Record end--ready to Paste" command, and then Paste it into and edit window or the macro dialog.
  70.  
  71.    When you have a command working correctly, you can add a macro to execute the command if you use it frequently.  To make a key macro, bring up the "Control Macro..." dialog (Command-D) and press the key you wish to remap.  You can also add a global menu macro by using the "Macros" "Add Macro..." command, or add a button macro by pressing on the button with the Option key held down.  (See the document "4. Macros" for more information on adding macros and the commands available.)
  72.  
  73.    All macro editing uses the same dialog, which offers buttons to enter commonly used keys on the VT220 and IBM 3270 keyboard.  
  74.  
  75.  
  76.        ___________________________________________________
  77.  
  78.          Editing and executing macros ("Shift-Enter")
  79.        ___________________________________________________
  80.  
  81.    After you've prepared a key macro using dataComet's "Record Actions for Macro..." command, you may want to edit it (especially on ASCII hosts, you will want to replace unnecessary "!D\002" two-second delays inserted by the automatic macro generator with "!D\000" delays (no delay).
  82.  
  83.    These delays are automatically inserted because some ASCII host applications present command prompts before they're ready to receive input, so the greater speed with which a macro executes may wind up sending a command to the application which the application will then drop, resulting in a failed macro.
  84.  
  85.    Only testing can tell whether a delay is adequate for a given host application.
  86.  
  87.    You use an edit window to modify and test macros to be sure they work reliably before placing them in a key, menu, or button by using the "Shift-Enter" key.  This key works like the "Enter" key, but tells the emulator window which receives the text to interpret it as a macro.  
  88.  
  89.    The "Command-Shift-Return" key functions in the same way, but breaks off the line before sending the text to the emulator window.
  90.  
  91.        ___________________________________________________
  92.  
  93.          Reformatting web page text
  94.        ___________________________________________________
  95.  
  96.    Web browsers often copy text with lines broken at odd places, and sometimes present you with pages of offset text which, when copied, yield text which has leading spaces.  Copies of these pages need to be reformatted when they are pasted into a Macintosh document.
  97.  
  98.    If you're copying text from a browser page and want to reformat it into a usable form using dataComet, you can do the following:  copy the text in the browser, switch to a dataComet edit window, paste the text, strip the leading spaces and tabs, unwrap the text by deleting carriage returns, and edit it.
  99.  
  100.    After you switch to dataComet, you can use key commands for the remaining tasks:
  101.  
  102.          Shift-Command-N     New text window
  103.                Command-V     Paste
  104.                Command-Z     
  105.                Command-Z     Undo twice to select Paste range
  106.   Option-Shift-Command-[     Strip all leading spaces and tabs
  107.          Shift-Command-/     Unwrap (strip Carriage Returns)
  108.  
  109.    If you're preparing the text to be entered in a host editor, you can then:
  110.  
  111.          Shift-Command-=     Resize window to 75 characters wide
  112.                Command-/     Wrap (add Carriage Returns)
  113.                    Enter     Paste through to the next frontmost session
  114.  
  115.  
  116. _____________________________________________________________________________
  117.